﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using SharpDX;
using SharpDX.D3DCompiler;
using SharpDX.Direct3D;
using SharpDX.Direct3D11;
using SharpDX.DXGI;
using SharpDX.Windows;
using Buffer=SharpDX.Direct3D11.Buffer;
using Device=SharpDX.Direct3D11.Device;
using MapFlags=SharpDX.Direct3D11.MapFlags;
using System.Windows.Forms;

namespace SharpDX
{
    public class CSystem
    {
        public CSystem appHandle;
        public string appName;
        public RenderForm mainForm;
        public FormWindowState curFormWindowState;

        public CGraphic graphics;


        public CSystem()
        {

        }
        public bool Initialize(int scW,int scH)
        {
            InitializeWindows();
            if(graphics==null)
            {
                graphics = new CGraphic();
                if (!graphics.Initialize(mainForm.Handle, scW, scH))
                    return false;
            }
            return true;
        }
        public void InitializeWindows(int scW,int scH)
        {
            if (mainForm != null)
                return;

            appHandle = this;
            appName = "Test";

            mainForm = new RenderForm(appName)
            {
                ClientSize=new System.Drawing.Size(scW,scH),
                FormBorderStyle=FormBorderStyle.FixedToolWindow
            };
            mainForm.Show();
        }

    }
}
